package com.swagger.swagger.controller;

import ch.qos.logback.classic.spi.STEUtil;
import com.swagger.swagger.entity.Student;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author Janson
 * @Date 2022/3/5 20:01
 * @Version 1.0
 */
//给接口加api注释
@RestController
public class Students {
    //只要我们的接口中，存在返回值实体类，他就会扫描到swagger 中
    //Operation给方法加注释
    @ApiOperation("控制了接口")
    @GetMapping("/student")
    public Student student(String name, String password){
        Student student = new Student();
        student.name = name;
        student.password = password;
        return student;
    }
}
